﻿@model KL.Store.Web.Models.RegisterModel
@using KL.Store.Data;
@using KL.Store.Core;
@using CaptchaMvc.HtmlHelpers;
@{
    ViewBag.Title = "Kayıt";
    Layout = "~/Views/Shared/" + Parameters.Layout + ".cshtml";
    var pageClass = "col-xs-12 col-sm-12 col-md-12 col-lg-12";
    var labelClass = "col-xs-3";
    var inputClass = "col-xs-9 col-sm-9 col-md-8 col-lg-6";
    var columnClass = "";
    var showAccount = false;
    var showInformation = false;
    if (Parameters.Theme == "DK" || Parameters.Theme == "EO")
    {
        showAccount = true;
        showInformation = true;
        labelClass = "col-xs-4";
        inputClass = "col-xs-8 col-sm-8 col-md-8 col-lg-6";
    }
    if (Parameters.Theme == "WU")
    {
        showAccount = true;
        showInformation = true;
        labelClass = "col-xs-4";
        inputClass = "col-xs-8 col-sm-8 col-md-8 col-lg-6";
    }
    if (Parameters.ShowCategoryOnAccountPages || showAccount || showInformation)
    {
        columnClass = "hidden-xs hidden-sm col-md-3 col-lg-2 left first last";
        pageClass = "col-xs-12 col-sm-12 col-md-9 col-lg-10 right";
        if (Parameters.Theme == "DK" || Parameters.Theme == "EO")
        {
            columnClass = "hidden-xs hidden-sm col-md-4 col-lg-3 left first last";
            pageClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
        }
        else if (Parameters.Theme == "WU")
        {
            columnClass = "hidden-xs hidden-sm col-md-4 col-lg-3 left";
            pageClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
        }
    }
}
    <div class="breadcrumb col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="bcBorder"></div>
        <div class="bcLinks">
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/" itemprop="url">
                    <span itemprop="title">Anasayfa</span>
                </a>›
            </div>
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/Account/Index" itemprop="url">
                    <span itemprop="title">Hesabım</span>
                </a>›
            </div>
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/Account/Register" itemprop="url">
                    <span itemprop="title">@ViewBag.Title</span>
                </a>
            </div>
        </div>
        <div class="bcBorder"></div>
    </div>
    <div class="clearfix"></div>
<div class="content">
    <div class="@columnClass">
        @if (Parameters.ShowCategoryOnAccountPages)
        {
            Html.RenderAction("Categories", "Partials");
        }
        @if (showAccount)
        {
            Html.RenderAction("Account", "Partials");
        }
        @if (showInformation)
        {
            Html.RenderAction("Information", "Partials");
        }
    </div>

    <div class="@pageClass">

        <h1>@ViewBag.Title</h1>
        <div class="bg-info bs-bg" style="margin-bottom: 15px;">
            <p>
                <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Dilerseniz vakit kaybetmeyin
                                <img src="/Images/@Parameters.Theme/fb-ile-baglan.png" />
                ile bağlanın.
            </p>
            <p><span class="glyphicon glyphicon-info-sign"></span>&nbsp;Önceden oluşturduğunuz bir hesabınız varsa lütfen <a href="/Account/Login">Giriş Sayfasını</a> kullanınız.</p>
        </div>
        @using (Html.BeginForm(null, null, null, FormMethod.Post, new { name = "register", id = "register", @class = "form-horizontal" }))
        { 
            <h3>Kişisel Bilgileriniz</h3>
            <div class="form-group">
                <label for="FirstName" class="@labelClass control-label">Adınız<span class="requireStar">*</span> : </label>
                <div class="@inputClass">
                    @Html.TextBoxFor(model => model.FirstName, new { @class = "form-control", maxlength = "50", placeHolder = "Adınızı Yazınız" })
                    @Html.ValidationMessageFor(model => model.FirstName)
                </div>
            </div>
            <div class="form-group">
                <label for="LastName" class="@labelClass control-label">Soyadınız <span class="requireStar">*</span> : </label>
                <div class="@inputClass">
                    @Html.TextBoxFor(model => model.LastName, new { @class = "form-control", maxlength = "49", placeholder = "Soyadınızı Yazınız" })
                    @Html.ValidationMessageFor(model => model.LastName)
                </div>
            </div>
            <div class="form-group">
                <label for="Email" class="@labelClass control-label">E-Posta Adresiniz <span class="requireStar">*</span> : </label>
                <div class="@inputClass">
                    @Html.TextBoxFor(model => model.Email, new { @type="email", @class = "form-control", maxlength = "50", placeholder = "E-Posta Adresinizi Yazınız" })
                    @Html.ValidationMessageFor(model => model.Email)
                </div>
            </div>
            <div class="form-group">
                <label for="ConfirmEmail" class="@labelClass control-label">E-Posta Adresiniz (Tekrar) <span class="requireStar">*</span> : </label>
                <div class="@inputClass">
                    @Html.TextBoxFor(model => model.ConfirmEmail, new { @type="email", @class = "form-control", maxlength = "50", placeholder = "E-Posta Adresinizi Yazınız" })
                    @Html.ValidationMessageFor(model => model.ConfirmEmail)
                </div>
            </div>
            <div class="form-group">
                <label for="Mobile" class="@labelClass control-label">Mobil Telefon Numaranız : </label>
                <div class="col-xs-4 col-sm-4 col-md-4 col-lg-3">
                    @Html.TextBoxFor(model => model.Mobile, new { @type="tel", @class = "form-control", maxlength = "40", placeholder = "Telefon Numaranızı Yazınız" })
                </div>
                <div class="col-xs-4 col-sm-4 col-md-4 col-lg-3">
                    <p>Örnek: 5xx1234567</p>
                </div>
                @Html.ValidationMessageFor(model => model.Mobile)
            </div>
            <h3>Şifreniz</h3>
            <div class="form-group">
                <label for="Password" class="@labelClass control-label">Şifreniz : </label>
                <div class="@inputClass">
                    @Html.PasswordFor(model => model.Password, new { @class = "form-control", maxlength = "20", placeholder = "Şifrenizi Yazınız", autocomplete = "off" })
                    @Html.ValidationMessageFor(model => model.Password)
                </div>
            </div>
            <div class="form-group">
                <label for="ConfirmPassword" class="@labelClass control-label">Şifreniz (Tekrar) : </label>
                <div class="@inputClass">
                    @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "form-control", maxlength = "20", placeholder = "Şifrenizi Yazınız", autocomplete = "off" })
                    @Html.ValidationMessageFor(model => model.ConfirmPassword)
                </div>
            </div>
            if (Parameters.UseCaptchaOnRegister)
            {
            <h3>Doğrulama</h3>
            @Html.Captcha("Yenile", "Doğrulama kodunu giriniz.", 5, "Bu alan zorunludur.");
            <br />
            }
            <h3>Bilgi ve Kampanya Mesajları</h3>
            <label for="NewsLetter">E-Posta</label>
            @Html.CheckBoxFor(model => model.NewsLetter)
            <label for="CampaingSMSAndEmail">SMS</label>
            @Html.CheckBoxFor(model => model.CampaingSMSAndEmail)
            <p>Eposta ve SMS üyeliğiniz sonrasında fırsat ve kampanyalarımız hakkında bilgilendirme yapılacaktır.</p>
            if (!ViewData.ModelState.IsValid)
            {
            <div class="bg-danger bs-bgb">
                @Html.ValidationSummary(true, "Kayıt işlemi başarısız oldu. Lütfen eksik bilgileri kontrol ediniz.")
            </div>
            <br />
            }
            <button onclick="frmSubmit();" class="btn btn-custom1">Kaydol</button>
        }
    </div>
</div>
<script type="text/javascript">
    jQuery(function ($)
    {
        $("#Mobile").mask("9999999999?");
        $("#Phone").mask("9999999999?");
        $("#Fax").mask("9999999999?");
    });

    function frmSubmit()
    {
        var isValid = $('#register').valid();
        if (isValid)
        {
            $('#register').submit();
        }
    }
    function KeyDown(e)
    {
        lastKey = e.keyCode;
        if (!(e.keyCode >= 48 && e.keyCode <= 57) && !(e.keyCode >= 96 && e.keyCode <= 105) && (e.keyCode != 9 && e.keyCode != 8 && e.keyCode != 46))
        {
            return false;
        }
    }
    //    $('a.agreement').click(function () {
    //        $("#dialog-agree").dialog("open");
    //        return false;
    //    });
    //    $(function () {
    //        $("#dialog:ui-dialog").dialog("destroy");

    //        $("#dialog-agree").dialog({
    //            autoOpen: false,
    //            height: 380,
    //            width: 490,
    //            modal: true
    //        });
    //    });
</script>
<script type="text/javascript" lang="javascript" src="~/Scripts/jquery.maskedinput.1.3.js">
</script>
@if (Parameters.WebSiteTrackingCode != "")
{ 
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '@Parameters.WebSiteTrackingCode']);
        _gaq.push(['_setDomainName', '@Parameters.WebSiteTrackingDomainName']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);

        (function ()
        {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
}
@Html.Raw(Parameters.RejoinerTrackingMemberPageScript)
@Html.Raw(Parameters.RegisterTraceScript)